﻿@model ThuySan.Models.ProductPropertyModel
@{
    ViewBag.Title = "Edit Property";
    Layout = "~/Areas/Backend/Views/Shared/_Dialog.cshtml";
}
@if (true == ViewBag.Completed)
{
    <script language="javascript">
        $(document).ready(function() {
            window.parent.closePopupEditProperty(true);
        })
    </script>
}
else
{
    using (Html.BeginForm("EditProperty", "Product", FormMethod.Post, new {
                                                                                 enctype = "multipart/form-data"
                                                                         }))
    {
        @Html.HiddenFor(c => c.ProductPropertyId)
        @Html.HiddenFor(c => c.ProductId)
        @Html.ValidationSummary()
        <div class="input-item">
            <label>
                Property</label>
            @Html.DropDownListFor(c => c.PropertyId, (IEnumerable<SelectListItem>) ViewBag.Properties, new {
                                                                                                                   style = "width: 300px;"
                                                                                                           })
        </div>
        <div class="input-item">
            <label>
                Checked</label>
            @Html.CheckBoxFor(c => c.Bit)
            @Html.ValidationMessageFor(c => c.Bit)
        </div>
        <div class="input-item">
            <label>
                Value</label>
            @Html.TextBoxFor(c => c.Numer, new {
                                                       @class = "text-input medium-input"
                                               })
            @Html.ValidationMessageFor(c => c.Numer)
        </div>
        <div class="input-item">
            <label>
                Description</label>
            @Html.TextAreaFor(c => c.Value, new {
                                                       @class = "text-input large-input"
                                               })
            @Html.ValidationMessageFor(c => c.Value)
        </div>
        <input type="submit" value="Update" class="button" />
        <input type="reset" value="Reset" class="button" onclick=" javascript:window.parent.closePopupEditProperty(); " />
    }
}